package com.raulraja.util.thumbnails.impl;

import com.raulraja.util.thumbnails.ThumbnailGenerator;

import java.io.InputStream;
import java.io.File;
import java.io.IOException;

/**
 * Empty impl for generating thumbnails for pdfs
 */
public class PDFThumbnailGeneratorImpl implements ThumbnailGenerator {
	/**
	 * Create the thumbnail.  The thumbnail should always save as a JPEG file.
	 *
	 * @param inputStream	  The source data.
	 * @param fileOut		  The output file.
	 * @param largestDimension The max width and height.  The generator should size the thumbnail so
	 *                         that the width and height both stay within this limit.
	 * @param hint			 Optional hint that was returned from the prior thumbnail generation
	 *                         on this same file, null if none was returned or if this is the first
	 *                         thumbnail in this context.
	 * @return an optional hint object that will be passed to subsequent thumbnail generation calls
	 *         for this same source data.  Return null if you don't use hints, otherwise return some
	 *         object which allows you to communicate extra information to the next round, such as
	 *         the scaled image already loaded.
	 */
	public Object createThumbnail(InputStream inputStream, File fileOut, int largestDimension, Object hint) throws IOException {
		throw new UnsupportedOperationException("thumbnails for pdf's not implemented in this tutorial...");
	}
}
